<template>
	<view class="container">
		<view class="shop-info">
			<view class="shop-item">
				<image src="../../static/images/tb_home.png" mode="aspectFit"></image>
				<input type="text" value="" v-model="shop_name" placeholder="请输入店铺名称" placeholder-class="f36 c999"/>
			</view>
			<view class="shop-item">
				<image src="../../static/images/tb_people.png" mode="aspectFit"></image>
				<input type="text" value="" v-model="boss_name" placeholder="请输入老板姓名" placeholder-class="f36 c999" />
			</view>
		</view>
		<view class="btn tCenter f36 cfff" @click="commit"><text>确定</text></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			shop_name: '',
			boss_name: ''
		};
	},


	methods: {
		commit() {
			this.$ajax('api/v1.shop/initialization', {
				shop_name: this.shop_name,
				boss_name: this.boss_name
			})
				.then(res => {
					setTimeout(function() {
						uni.switchTab({
							url: '../shop/index',
							icon: 'none'
						});
					}, 1500);
				})
				.catch(res => {
					console.log(Error);
				});
		},
		
	}
};
</script>

<style lang="scss">
page {
	background-color: #f7f4f8;
}
.btn {
	padding: 0 30upx;
	margin-top: 100upx;
	text {
		display: block;
		background-color: #249af6;
		height: 80upx;
		line-height: 80upx;
	}
}
.shop-info {
	background-color: $white-background;
	padding: 0 30upx;
	margin-top: 30upx;
	.shop-item {
		display: flex;
		flex-direction: row;
		align-items: center;
		height: 125upx;
		line-height: 125upx;
		border-bottom: 2upx #eee solid;
		image {
			width: 44upx;
			height: 44upx;
			margin-right: 25upx;
		}
		input {
			width: 100%;
			height: 125upx;
			line-height: 125upx;
			font-size: 36rpx;
			color: #999;
		}
	}
}
</style>
